import numpy

from elements import elements

class Speck:

    def __init__(self):
        self.r = numpy.array([])
        self.m = numpy.array([])
        self.symbols = []
        pass

    def __len__(self):
        return len(self.r)
        
    def addAtom(self, symbol, r):
        if len(self.r) == 0:
            self.r = numpy.array([r])
            self.m = numpy.array([[elements[symbol]['mass']]])
        else:
            self.r = numpy.append(self.r, [r], axis = 0)
            self.m = numpy.append(self.m, [[elements[symbol]['mass']]], axis=0)
        self.symbols.append(symbol)
        
        
